package com.javaxxf.controller;
import com.javaxxf.pojo.User;
import com.javaxxf.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/**
 * @author xuxiaofei
 * @date 2021年09月30日下午12:45
 * @联系作者：如果你有什么不懂，可以加作者微信 xxf960513 一起交流学习
 */
public class UserController {
    public static void main(String[] args) {
        ApplicationContext ac=new ClassPathXmlApplicationContext("applicationContext.xml");
        UserService userService= (UserService) ac.getBean("userService");
       //根据id查询user
        User user = userService.findById(1);
        System.out.println("根据id查询user："+user);
    }
}








